github.com/0chain/gosdk@v1.17.11/docs/uml/get download cost.puml (about)

     1  @startuml
     2  participant "<size:20><&terminal></size> ./zbox get-download-cost" as cli
     3  collections gosdk
     4  collections blobber
     5  
     6  alt not empty remotepath
     7  cli -> gosdk: GetAllocation(allocationID)
     8  cli -> gosdk: GetFileMeta(remotePath)
     9  
    10  gosdk -> gosdk: check initialized allocation
    11  gosdk -> gosdk: create list request
    12  
    13  group for each blobber (blobber, bidx)
    14  gosdk -> blobber: call http request to get file meta
    15  alt successful status code
    16  blobber --> gosdk: return file meta
    17  end
    18  end
    19  
    20  group for each file meta return from blobber (fileref, idx)
    21  alt number of actual hash greater than number of consensus
    22  gosdk -> gosdk: increase consensus
    23  end
    24  alt number of consensus already met threshold
    25  gosdk -> gosdk: return current fileref and create corresponding foundMask
    26  end
    27  end
    28  
    29  alt not empty fileref
    30  gosdk -> cli: return consolidated file meta
    31  end
    32  
    33  else
    34  cli -> gosdk: GetAllocationFromAuthTicket(authticket)
    35  cli -> gosdk: InitAuthTicket(authticket)
    36  alt length of lookuphash equal 0
    37  cli -> gosdk: GetLookupHash()
    38  end
    39  cli -> gosdk: GetFileMetaFromAuthTicket(authticket, lookuphash)
    40  
    41  gosdk -> gosdk: check initialized allocation
    42  gosdk -> gosdk: get auth ticket from authticket
    43  gosdk -> gosdk: check valid hash
    44  gosdk -> gosdk: create list request
    45  
    46  group for each blobber (blobber, bidx)
    47  gosdk -> blobber: call http request to get file meta
    48  alt successful status code
    49  blobber --> gosdk: return file meta
    50  end
    51  end
    52  
    53  group for each file meta return from blobber (fileref, idx)
    54  alt number of actual hash greater than number of consensus
    55  gosdk -> gosdk: increase consensus
    56  end
    57  alt number of consensus already met threshold
    58  gosdk -> gosdk: return current fileref and create corresponding foundMask
    59  end
    60  end
    61  
    62  alt not empty fileref
    63  gosdk -> cli: return consolidated file meta
    64  end
    65  
    66  end
    67  @enduml